package droid.ru;

import java.util.Calendar;
import java.util.Date;

public class DateUtils {
	
	// Returns true if a date belongs to the current week
	public static boolean dateIsUpToDate(Date d)
	{
		return false;
	}
	
	// Returns true if current date is Sunday or Saturday
	public static boolean isWeekend()
	{
		Date today = Calendar.getInstance().getTime();		
		int dayOfWeek = today.getDay();
		if(dayOfWeek > 0 && dayOfWeek < 6)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	
	// Returns an integer representing the day of week (0 to Sunday..6 to Saturday)
	public static int getWeekDay()
	{
		Date today = Calendar.getInstance().getTime();		
		int dayOfWeek = today.getDay();
		if(dayOfWeek > 0 && dayOfWeek < 6)
			return dayOfWeek - 1;
		else
		{
			return 0;
		}
	}

}
